<template>
    <div>
        <div class='task-item' @click="check">
            <div>{{ task.name }}</div>
            <div @click.stop="remove" class='x'>x</div>
        </div>
    </div>
</template>

<script>
export default {
  props: {
    task: {
      type: Object,
    },
    index: Number,
  },
  methods: {
    check() {
      this.$emit('check', this.task);
    },
    remove() {
      this.$emit('remove', this.task);
    },
  },
};
</script>

<style lang="scss" scoped>
    .task-item{
        width: 200px;
        display: flex;
        justify-content: space-between;
        margin-bottom: 20px;
    }
    .task-item:hover{
        background-color: rgb(207, 207, 207);
        cursor: pointer;
        align-content: center;
    }
    .x{
      cursor: pointer;
    }
</style>
